#include <iostream>
#include <sstream>
#include <string>
using namespace std;

int main(int argc, char* argv[]){
	int sum = 0;
	istringstream iss(argv[1]);
	if (argc > 0){
		for (int i = 0; i < argc; i++){
			cout << "argv[" << i << "] = " << argv[i] << endl;
		}

		int val;
		iss >> val;
		for (int i = 0; i < val; i++){
			sum += i + 1;
		}
		cout << "sum = " << sum << endl;
	}
	system("pause");
}